// import Cookies from 'js-cookie'
// const Cookie = require('./cookie.js')
const Store = window.require('electron-store');

const store = new Store();
// store.set('unicorn', '123');
// console.log(store.get('unicorn'));
// //=> '123'

// // Use dot-notation to access nested properties
// store.set('foo.bar', true);
// console.log(store.get('foo'));
// //=> {bar: true}

// store.delete('unicorn');
// console.log(store.get('unicorn'));
// //=> undefined

// // 判断是否存在
// store.has('unicorn')
// //=> false


const TokenKey = 'Admin-Token'

export function getToken() {
  // return Cookies.get(TokenKey)
  return store.get(TokenKey) 
}

export function setToken(token) {
  // return Cookies.set(TokenKey, token)
  return store.set(TokenKey, token);
}

export function removeToken() {
  // return Cookies.remove(TokenKey)
  return store.delete(TokenKey) 
}
